<!--
	作者：2575202388@qq.com
	时间：2018-10-14
	描述：学生搜索
-->
<template>
    <div style="width:100%;"> 
        <Fytable ref="tdtable" height="550" :columns="columns9" type="post" :paramiters="tj" :serverUrl="serverUrl"></Fytable>
        <look ref="look" :params="lookparam"></look>
        <setbmcgh ref="setbmcgh" @set_sfbmcg="set_sfbmcg"></setbmcgh>
        <ccsh ref="ccsh"  @reload="load" :params="lookparam"></ccsh>   
    </div> 
</template>
<script>
	import EditDelLook from "./EditDelLook";
	import look from "./look";
	import bmcgh from "./bmcgh";
	import setbmcgh from "./setbmcgh";
	import ccsh from "./ccsh";
    export default {
    	name: "studentss",
    	props: {
    		tj:{
    			type: Object
    		}
    	},
        data () {
            return {
            	serverUrl:"/host/bmxt/student/Search_Student.html",
                columns9: [
                    {
                        type: 'index',
                        width: 60,
                        title: '序号',
                        align: 'center'
                    },{
                        title: '学校',
                        key: 'CSNAME',
                        align: 'center',
                    },{
                        title: '报名号',
                        key: 'BMH',
                        align: 'center',
                    },{
                        title: '学生姓名',
                        key: 'SNAME',
                        align: 'center',
                    },
                    {
                        title: '年级',
                        key: 'NJ',
                        align: 'center',
                    },
                    {
                        title: '身份证号',
                        key: 'SFZH',
                        align: 'center'
                    },{
                        title: '户籍所在地',
                        key: 'HJSZDT',
                        align: 'center'
                    },{
                        title: '生日',
                        key: 'BIRTH',
                        align: 'center'
                    },{
                        title: '性别',
                        key: 'SEX',
                        align: 'center'
                    },{
                        title: '登记时间',
                        key: 'BMSJ',
                        align: 'center'
                    },{
                        title: '家长姓名',
                        key: 'JZXM',
                        align: 'center'
                    },{
                        title: '家长手机',
                        key: 'JZSJ',
                        align: 'center'
                    }, {
                        title: '初审结果',
                        key: 'CCSHT',
                        align: 'center'
                    },{
                        title: '初审失败原因',
                        key: 'SBYY',
                        align: 'center'
                    },{
                        title: '状态',
                        key: 'SFBMCGT',
                        align: 'center',
                        render: (h, params) => {
                        	
                        	return h(bmcgh, { 
                        		props: {
                                    sfbmcg: params.row.SFBMCG+"",
                                    sfbmcgt:params.row.SFBMCGT
                                },
	                        	on: { 
	                        		updateBmzt: () => {
	                        			this.sid=params.row.SID;
	                        			this.$refs.setbmcgh.modal0=true;
	                        		}
	                        	} 
                        	})

                        }
                    },      
                    {
                        title: '操作',
                        key: 'action',
                        width: 150,
                        align: 'center',
                        render: (h, params) => {
                            return h(EditDelLook, {
                            	on: {
                                    //查看学生
                                    look: () => {
                                    	const rows=params.row;
                                    	this.lookparam=rows
                                        this.$refs.look.modal0=true;
                                    },
                                    //初审
                                    ccsh: () => {
                                    	const rows=params.row;
                                    	this.lookparam=rows
                                        this.$refs.ccsh.modal0=true;
                                    },
                                    //删除学生
                                    remove: () =>{
                                    	const rows=params.row;
                                        this.remove(rows.SID)
                                    },
                                    
                                }
                            });
                        }
                    }
                ],
                lookparam:{},
                sid:''
            }
        },
        computed: {
		},
		methods: {
			//删除学生
			remove:function(sid){
                this.$Modal.confirm({
                    title: '警告',
                    content: '请确定是否删除！！！',
                    onOk: () => {
                    	//执行删除代码
                    	this.$http.get("/host/bmxt/student/del_Student.html?sid="+sid)
						.then(datas => {
							if(datas.result){
								//删除成功 刷新页面
								this.$Message.info('删除成功');
								this.$refs.tdtable.load();
							}else{
								//删除成功 刷新页面
								this.$Message.info(datas.msg);
								this.$refs.tdtable.load();
							}
							
						});
                    }
                });
			},
			
			
			load(){
				this.$refs.tdtable.load();
			},

			set_sfbmcg(sfbmcg){
				var sid=this.sid;
            	this.$http.get("/host/bmxt/student/set_sfbmcg.html?sid="+sid+"&sfbmcg="+sfbmcg)
				.then(datas => {
					if(datas){
						this.$Modal.success({
                            title: "成功",
                            content: "修改成功！"
                        });	
                        this.$refs.setbmcgh.modal0=false;
						this.$refs.tdtable.load();
					}else{
						this.$Modal.error({
                            title: "失败",
                            content: "修改失败！"
                        });	
						this.$refs.tdtable.load();
					}
					
				});
			}
	    },
		mounted() {
		},
		watch:{
		},
		components: {
			EditDelLook,
			look,
			bmcgh,
			setbmcgh,
			ccsh
		}
    }
</script>


<style scoped="scoped">
	
	.ivu-table-wrapper {
		border:none;
	}
	
	.toolstipdiv{
		width: '100%';
		overflow: 'hidden';
		textOverflow: 'ellipsis';
		whiteSpace: 'normal';
		wordBreak: 'break-all';
		color:'#fff';
		text-align: center;
	}
	.toolstipdiv:hover{
		background:rgb(63, 193, 201);
	}
	
	.ivu-tooltip-rel label:hover{
		color:#0023FB;
	}
	
	.tablediv{
		height: '40px';
		overflow:'hidden';
		line-height: '40px';
	}
</style>



